/*
 * signal_h.c
 *
 *  Created on: Feb 26, 2012
 *      Author: albert
 */
#include <signal.h>
#include <stdlib.h>
extern void block_signal(int signo) {
	sigset_t set;

	/* Block the signal */
	sigemptyset(&set);
	sigaddset(&set, signo);
	sigprocmask(SIG_BLOCK, &set, NULL);

	return;
}

extern void unblock_signal(int signo) {
	sigset_t set;

	/* Unblock the signal */
	sigemptyset(&set);
	sigaddset(&set, signo);
	sigprocmask(SIG_UNBLOCK, &set, NULL);

	return;
}
